package com.yanqu.road.server.cmd.beauty;

import com.yanqu.road.pb.beauty.BeautyPalyProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.player.BeautyModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

import java.util.List;

@Cmd(code = Protocol.S_BEAUTY_FAVOR_ANSWER, desc = "美女宠幸答题")
public class BeautyFavorAnswerCmd extends AbstractCommand {

    List<BeautyPalyProto.BeautyFavorAnswerEntity> answerList ;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        BeautyPalyProto.BeautyFavorAnswerReqMsg req = BeautyPalyProto.BeautyFavorAnswerReqMsg.parseFrom(packet.getBytes());
        answerList = req.getAnswerListList();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        BeautyPalyProto.BeautyFavorAnswerRespMsg.Builder respMsg = player.getModule(BeautyModule.class).beautyFavorAnswer(answerList);
        player.sendPacket(Protocol.U_BEAUTY_FAVOR_ANSWER, respMsg);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
